<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\bootstrap\ActiveForm;
?>

<div class="text-center">
<hr>

	<?php 
		if($model->status == 2 ){ // 操作审核成功
			echo "<div class='alert alert-warning'>操作审核成功 </div>";	
		}elseif($model->status == 3){
			echo "<div class='alert alert-warning'>财务审核成功 </div>";	
		}elseif($model->status == 4){
			echo "<div class='alert alert-danger'>操作驳回</div>";	
		}elseif($model->status == 4){
			echo "<div class='alert alert-danger'>财务驳回</div>";	
		}
	?>
	<?php
	//if($model->type == 2){ // 应收账款
		if($model->status == 1){ // 操作审批
			if($role == "管理员"){
	?>
		    	<?php $form = ActiveForm::begin(['action' => 'status']); ?>
					<input type="hidden" name="id" value="<?= $model->id ?>">
					<?= \yii\helpers\Html::radioList("status", 2, [2=>'通过', 4=>'拒绝']) ?>	
					<button type="submit" class="btn btn-default">操作审核</button>
	    		<?php ActiveForm::end(); ?>
	
	<?php
			}
		}
	?>
	
	<?php
		if($model->status == 2){ // 操作审批成功
			if($role == "财务"){
	?>
		    	<!-- ?php $form = ActiveForm::begin(['action' => 'status']); ?>
					<input type="hidden" name="id" value="<?= $model->id ?>">
					</?= \yii\helpers\Html::radioList("status", 3, [3=>'通过', 5=>'拒绝']) ?>
					<button type="submit" class="btn btn-default">财务审核</button>
	    		</?php ActiveForm::end(); ? -->
	<?php
			}
		}
	?>
	
</div>
	<!-- 变更 应收账款类型 -->
	<p class="panel-body" style="margin-top: 30px;">
	<a href="/finance/finance/edit-type?id=<?= $model->id ?>" class="btn btn-sm btn-danger">变更为收款单</a>
	</p>

